<?php


/**
 * Notes:
 * PROJECT_NAME : ERP v1.8 重构erp
 * User: 夏鱼儿<397072174@qq.com>
 * Date: 2023/12/28
 * Time: 16:13
 */

namespace app\admin\validate;

use think\Validate;

class CateValidate extends Validate
{
    protected $rule = [
        'name'  => 'require|max:100',
        'pid'   => 'require|number',
        'page'  => 'require',
        "limit" => "require",
        'id'    => 'require',
    ];

    protected $message = [
        'name.require'  => '请输入分类名称',
        'pid.require'   => '请选择上级分类',
        'pid.number'    => 'pid类型不正确',
        'page.require'  => '请输入页码',
        'limit.require' => '请输入每页显示条数',
        'id.require'    => '请选择要操作的数据',
    ];

    protected $scene = [
        'list'       => ['page', 'limit'],
        'add'        => ['name'],
        "edit"       => ['id'],
        "editStatus" => ['id'],
        "del"        => ['id'],
    ];
}